package net.hnedu.action;

import org.apache.struts.action.*;
import org.apache.struts.validator.*;
import javax.servlet.http.*;
import net.hnedu.xml.SubjectMenu;
import net.sf.navigator.menu.MenuComponent;

public class UserSubjectAction
    extends MyDispatchAction {

  public ActionForward execute(ActionMapping actionMapping,
                                ActionForm actionForm,
                                HttpServletRequest request,
                                HttpServletResponse response) throws Exception {
     String id = request.getParameter("id");
     String adujst = "&amp;";
     String url =
         "/initResColumnAction.do?method=showResCenter" + adujst + "catalogModel=subject"
         + adujst + "catalogId=";
     String method = request.getParameter("method");
     SubjectMenu tree = new net.hnedu.xml.SubjectMenu();
    tree.setActionUrl("/userSubjectAction.do");
    tree.setTarget("main");
    MenuComponent menu = null;
    if (id == null) {
      menu = tree.getMenu("", method,url);
    }
    else {
      menu = tree.getMenu(id, method,url);
    }

    request.setAttribute("audience", menu);
    return actionMapping.findForward(method);
  }
}
